package com.ruoyi.test.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.test.domain.ParamEdit;
import com.ruoyi.test.service.IParamEditService;
import com.ruoyi.test.service.IdataInsertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/test/data")
public class DataTableController extends BaseController {


    @Autowired
    private IParamEditService paramEditService;

    @Autowired
    private IdataInsertService dataInsertService;

    /**
     * 查询接口管理列表
     */
    @GetMapping(value = "/{id}")
    public List list(@PathVariable("id") Long id)
    {
        int tableExist = paramEditService.tableExist(id);
        if (tableExist == 0){
            paramEditService.createTable(id);
        }
       List list = paramEditService.selectDataList(id);
        return list;
    }
}


